import request from '../utils/request.js';

// export const getCategoryList = params => axios.get(`/web/category/getCategoryList?type=${params}`) // 获取分类列表

// 获取全部分类
export const getCategoryList = (params) => {
	return request({
		url: `/web/category/getCategoryList?type=${params}`,
		method: 'get',
	})
}

// 获取分类列表	
export const getVideoListByCategoryId = (params) => {
	return request({
		url: `/web/category/getVideoListByCategoryId`,
		method: 'get',
		params
	})
}

// 根据id获取课程详情	
export const getVideoInfo = (params) => {
	return request({
		url: `/web/category/getVideoInfo`,
		method: 'get',
		params
	})
}

// 取消收藏 /收藏
export const toggleCollect = (data) => {
	return request({
		url: `/web/usercollect/toggleCollect`,
		method: 'post',
		data
	})
}

// 获取课程列表视频
export const getvdeosList = (id) => {
	return request({
		url: `/biz/detail/cid/${id}`,
		method: 'get',
	})
}


// 获取观看课程列表视频
export const selectUserViewList = (params) => {
	return request({
		url: `/web/userview/selectUserViewList`,
		method: 'get',
		params
	})
}

//获取直播列表
export const selectLiveList = (params) => {
	return request({
		url: `/web/live/selectLiveList`,
		method: 'get',
		params
	})
}